package effect.character.area;

import character.MyCharacter;
import modifier.character.CharacterModifierPoison;

public class AreaCharacterEffectFactory {
    
    public static AreaCharacterEffect getAreaCharacterEffect(MyCharacter owner, AreaCharacterEffectEnum areaCharacterEffectEnum) {
        AreaCharacterEffect areaCharacterEffect = new AreaCharacterEffect(owner);
        populateAreaCharacterEffect(areaCharacterEffect, areaCharacterEffectEnum);
        switch(areaCharacterEffectEnum) {
            case EXPLOSION:
                break;
            case LIGHTNING:
                break;
            case MASS_HEAL:
                break;
            case POISON_CLOUD:
                areaCharacterEffect.addCharacterModifier(new CharacterModifierPoison(owner, Math.round(areaCharacterEffectEnum.getBaseEffectAmount()), areaCharacterEffectEnum.getBaseDuration()));
                break;
        }
        return areaCharacterEffect;
    }

    protected static void populateAreaCharacterEffect(AreaCharacterEffect areaCharacterEffect, AreaCharacterEffectEnum areaCharacterEffectEnum) {
	areaCharacterEffect.setEffectName(areaCharacterEffectEnum.getEffectName());
        areaCharacterEffect.setEffectType(areaCharacterEffectEnum.getEffectType());
	areaCharacterEffect.setBaseSpeed(areaCharacterEffectEnum.getBaseSpeed());
	areaCharacterEffect.setRangePattern(areaCharacterEffectEnum.getRangePattern());
	areaCharacterEffect.setRangeSize(areaCharacterEffectEnum.getRangeSize());
	areaCharacterEffect.setEffectPattern(areaCharacterEffectEnum.getEffectPattern());
	areaCharacterEffect.setEffectSize(areaCharacterEffectEnum.getEffectSize());
        areaCharacterEffect.setBaseEffectAmount(areaCharacterEffectEnum.getBaseEffectAmount());
        areaCharacterEffect.setBaseDuration(areaCharacterEffectEnum.getBaseDuration());
    }
}
